package pers.linkong.asr.util;

import java.util.List;

import pers.linkong.asr.domain.CourseSublevelBean;
import pers.linkong.asr.service.CourseService;


    /**
    * @ClassName: CourseKit
    * @Description: TODO(课程工具包)
    * @author 独木林空
    * @date 2018年8月7日
    *
    */
    
public class CourseKit {
	public static CourseSublevelBean getCourseBySclass(List<CourseSublevelBean> csbeans, CourseService courseService){
		CourseSublevelBean csbean = null;
		for(int i = 0 ; i < csbeans.size() ; i++) {
			csbean = csbeans.get(i);
			int nowweeknum = courseService.getNowWeekNum(csbean.getCid());
			System.out.println(Thread.currentThread().getStackTrace()[1].getClassName() + "：针对本课程，当前是第" +nowweeknum + "周");
			ResultInfo resultInfo =  StringKit.selectNumInStr(csbean.getWeekNumber(), nowweeknum);
			System.out.println(Thread.currentThread().getStackTrace()[1].getClassName() + "：" +"code:" +resultInfo.getCode() + " " + resultInfo.getMsg());
			if(resultInfo.getCode() == 1){
				return csbean;
			}
		}
		return null;
	}
}
